﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using MiniStock.Client.UI.QueryService;

namespace MiniStock.Client.UI.Models
{
    public class CreateProductModel
    {
        [Required]
        public string Name { get; set; }

        [Required]
        public string ProductNumber { get; set; }

        public Guid? Id { get; set; }
    }

    public class ChangeProductNumberModel
    {
        [Required]
        public string ProductNumber { get; set; }

        public Guid? Id { get; set; }

        public ChangeProductNumberModel()
        {
        }

        public ChangeProductNumberModel(Product item)
        {
            this.Id = item.Id;
            this.ProductNumber = item.ProductNumber;
        }
    }

    public class ChangeManufacturerModel
    {
        [Required]
        public Guid? ManufacturerId { get; set; }

        public string ManufacturerName { get; set; }

        public Guid? Id { get; set; }

        public ChangeManufacturerModel()
        {
        }

        public ChangeManufacturerModel(Product item)
        {
            this.Id = item.Id;
            if (item.Manufacturer != null)
            {
                this.ManufacturerId = item.Manufacturer.Id;
                this.ManufacturerName = item.Manufacturer.Name;
            }
        }
    }

}